@model Web.Models.Category

@{
    ViewBag.Title = "Category Details";
}

<h2>Category Details</h2>
<h4>
    @TempData[Web.Infrastructure.Constants.TempDataMessage]
</h4>

<fieldset>
    <legend>Category</legend>

    <div class="display-label">Name</div>
    <div class="display-field">@Model.Name</div>

    <div class="display-label">Products</div>
        <table id="products">
    @foreach (var product in Model.Products)
    {
        <tr>
            <td>@Html.ActionLink(product.Name, "Details", "Products", new { id = product.Id }, null)</td>
        </tr>
    }
    </table>
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id=Model.Id }) |
    @Html.ActionLink("Back to List", "Index")
</p>
